package com.itheima.controller;

import com.itheima.domain.SmsCode;
import com.itheima.service.MesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.*;

/**
 * @author tongchen
 * @create 2022-12-22 11:39
 */
@RestController
@RequestMapping("/sms")
public class MsgController {
    @Autowired
    MesService mesService;

    @GetMapping("{tele}")
    public String getIdentity(@PathVariable String tele){
       return mesService.sendMessage(tele);
    }
    @PostMapping()
    public boolean identifyTrue(@RequestBody SmsCode smsCode){
        return mesService.checkMessage(smsCode);
    }

}
